<template>
  <div>
    <el-drawer title="详情" size="800px" :visible.sync="isShowModal">
      <!-- <div class="mb20">
        <span class="property-title">发布计划</span>
      </div> -->
      <el-form label-suffix="：" label-width="120px">
        <el-form-item label="计划名称">
          <span>{{ detail.name }}</span>
        </el-form-item>
        <el-form-item label="接受对象">
          <span>{{ detail.portraitName }}</span>
        </el-form-item>
        <el-form-item label="发布内容">
          <template v-for="(item, i) in detail.grantObjList">
            <span :key="i">{{ item.name }}</span>
            <span v-if="i !== detail.grantObjList.length - 1" :key="i">，</span>
          </template>
        </el-form-item>
        <el-form-item label="短信通知">
          <span>{{
            detail.smsSend == "1" ? "不发短信通知" : "发送短信通知"
          }}</span>
        </el-form-item>
        <el-form-item v-if="detail.smsSend == '0'" label="短信内容">
          <span v-if="detail.smsInfo">{{ detail.smsInfo }}</span>
          <span v-if="detail.tempName">模板{{ detail.tempName }}</span>
        </el-form-item>

        <div class="mb20">
          <span class="property-title">营销计划</span>
        </div>
        <el-form-item label="首次执行时间">
          <span>{{ detail.firstTime }}</span>
        </el-form-item>
        <el-form-item label="执行频次">
          <span>每{{ detail.interval }}天运行一次</span>
        </el-form-item>
        <el-form-item label="执行次数">
          <span>持续运行{{ detail.allNum }}次后，停止运行</span>
        </el-form-item>
        <el-form-item label="执行对象">
          <span>{{
            detail.objType == "1" ? "满足条件的新增会员" : "满足条件的全部会员"
          }}</span>
        </el-form-item>
      </el-form>
    </el-drawer>
  </div>
</template>

<script>
import {
  marketingPlanDetail
} from '@/api'
export default {
  data() {
    return {
      detail: {},
      isShowModal: false
    }
  },
  methods: {
    getDetail(id) {
      marketingPlanDetail({ param: { id }}).then(res => {
        if (res.errorCode !== '000000') return
        this.detail = res.record
      })
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
